/** *******************************************************************
 * FlexDatabaseManager
 * @author  Jonnie Spratley
 * @contact jonniespratley@gmail.com
 * @internal
 ******************************************************************* */
package com.jonniespratley.flexdatabasemanager.business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;

	public class MySQLHelpDelegate
	{
		private var responder:IResponder;
		private var service:Object;

		public function MySQLHelpDelegate( responder:IResponder )
		{
			this.service = ServiceLocator.getInstance().getHTTPService( 'HelpService' );
			this.responder = responder;
		}

		/************** ServiceCalls ********************/
		
		public function getHelp():void
		{
			var token:AsyncToken = this.service.send();
				token.addResponder( responder );
				token.time = new Date();
		}	
		
		public function searchHelp( aSearch:String ):void
		{
			var token:AsyncToken = this.service.send( { s: aSearch } );
				token.addResponder( responder );
				token.search = aSearch;
				token.time = new Date();
		}	
	}
}